package com.nervenets.web.hibernate.dao;

import com.nervenets.web.hibernate.domain.user.User;
import com.nervenets.web.hibernate.domain.user.UserFav;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

@Repository
public interface UserFavDao extends JpaRepository<UserFav, Long>, JpaSpecificationExecutor<UserFav> {
    UserFav findByUserIdAndUser(long userId, User user);

    Page<UserFav> findAllByUserId(long userId, Pageable pageable);
}
